#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int ans=50, n;
ll m, a[50], sum[50];

bool cmp(int x, int y)
{
	return x > y;
}

void dfs(int S, int i, int cnt)
{
	if(cnt >= ans)
		return;
	if(S == m)
		ans =  min(ans, cnt);
	if(i>=n || S>=m || S+sum[i]<m)
		return;
	dfs(S+a[i], i+1, cnt);
	dfs(S+a[i]/2, i+1, cnt+1);
	dfs(S, i+1, cnt);
		
}

int main()
{
	cin >> n >> m;
	m *= 2;
	for(int i=0; i<n; i++)
	{
		cin >> a[i];
		a[i] *= 2;
	}
	sort(a, a+n, cmp);
	
	for(int i=n-1; i>=0; i--)
	{
		sum[i] = sum[i+1] + a[i];
	}
	dfs(0, 0, 0);
	if(ans == 50)
		cout << -1;
	else
		cout << ans << endl;
	return 0;
 } 